#include<bits/stdc++.h>
using namespace std;
long long a,b[200100],c[200100],d,n,m;
int main()
{
	freopen("color.in","r",stdin);
	freopen("color.out","w",stdout);
	cin>>n;m=n-1;
	for(int i=1;i<=n;i++)
	{
		cin>>c[i];
	}
	sort(c+1,c+n+1);
	for(int i=1;i<=n;i++)
	{
		if(c[i]!=c[i-1]){m--;
		}
	}
	cout<<m;
	return 0;
} 
